#include <stdio.h>
int main()
{
    int old[9][9], birth[9][9]; //旧的培养基和新的培养基，用于递推
    int m, n;                   //初始中央细菌数以及递推的天数
    int i, j, p;
    scanf("%d%d", &m, &n);
    for (i = 0; i < 9; i++)
        for (j = 0; j < 9; j++)
        {
            birth[i][j] = 0; //变量的初始化
        }
    birth[4][4] = m;         //中央细菌已经长出
    for (p = 1; p <= n; p++) //开始递推
    {
        for (i = 0; i < 9; i++)
            for (j = 0; j < 9; j++)
            {
                old[i][j] = birth[i][j];       //旧培养基相当于一个储存容器，储存上一天的培养基情况
                birth[i][j] = 2 * birth[i][j]; //每个位置上的每个旧细菌生两个崽，然后凋亡
            }
        for (i = 0; i < 9; i++)
            for (j = 0; j < 9; j++)
            {
                if (old[i][j] != 0) //如果旧培养基上某个位置有细菌，就在新培养基上它的周围生出一圈崽儿（记得每个细菌各生一圈儿……）
                {
                    birth[i - 1][j - 1] = birth[i - 1][j - 1] + old[i][j]; // 如果中间有n个细菌，那么周围的一圈都会增加n个细菌，所以这里会加old[i][j]
                    birth[i - 1][j] = birth[i - 1][j] + old[i][j];
                    birth[i - 1][j + 1] = birth[i - 1][j + 1] + old[i][j];
                    birth[i][j - 1] = birth[i][j - 1] + old[i][j];
                    birth[i][j + 1] = birth[i][j + 1] + old[i][j];
                    birth[i + 1][j - 1] = birth[i + 1][j - 1] + old[i][j];
                    birth[i + 1][j] = birth[i + 1][j] + old[i][j];
                    birth[i + 1][j + 1] = birth[i + 1][j + 1] + old[i][j];
                }
            }
    }
    for (i = 0; i < 9; i++)
    {
        for (j = 0; j < 9; j++)
            printf("%d ", birth[i][j]);
        printf("\n");
    }
    return 0;
}